Optimal. Leaf size=65 \[ \frac {b \sin (x)}{a^2+b^2}-\frac {a \cos (x)}{a^2+b^2}+\frac {a b \tanh ^{-1}\left (\frac {b \cos (x)-a \sin (x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {3109, 2637, 2638, 3074, 206} \[ \frac {b \sin (x)}{a^2+b^2}-\frac {a \cos (x)}{a^2+b^2}+\frac {a b \tanh ^{-1}\left (\frac {b \cos (x)-a \sin (x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 2637
Rule 2638
Rule 3074
Rule 3109
Rubi steps
\begin {align*} \int \frac {\cos (x) \sin (x)}{a \cos (x)+b \sin (x)} \, dx &=\frac {a \int \sin (x) \, dx}{a^2+b^2}+\frac {b \int \cos (x) \, dx}{a^2+b^2}-\frac {(a b) \int \frac {1}{a \cos (x)+b \sin (x)} \, dx}{a^2+b^2}\\ &=-\frac {a \cos (x)}{a^2+b^2}+\frac {b \sin (x)}{a^2+b^2}+\frac {(a b) \operatorname {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,b \cos (x)-a \sin (x)\right )}{a^2+b^2}\\ &=\frac {a b \tanh ^{-1}\left (\frac {b \cos (x)-a \sin (x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}-\frac {a \cos (x)}{a^2+b^2}+\frac {b \sin (x)}{a^2+b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.14, size = 61, normalized size = 0.94 \[ \frac {b \sin (x)-a \cos (x)}{a^2+b^2}-\frac {2 a b \tanh ^{-1}\left (\frac {a \tan \left (\frac {x}{2}\right )-b}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.65, size = 142, normalized size = 2.18 \[ \frac {\sqrt {a^{2} + b^{2}} a b \log \left (\frac {2 \, a b \cos \relax (x) \sin \relax (x) + {\left (a^{2} - b^{2}\right )} \cos \relax (x)^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \relax (x) - a \sin \relax (x)\right )}}{2 \, a b \cos \relax (x) \sin \relax (x) + {\left (a^{2} - b^{2}\right )} \cos \relax (x)^{2} + b^{2}}\right ) - 2 \, {\left (a^{3} + a b^{2}\right )} \cos \relax (x) + 2 \, {\left (a^{2} b + b^{3}\right )} \sin \relax (x)}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 5.98, size = 94, normalized size = 1.45 \[ \frac {a b \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, x\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, x\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, x\right ) - a\right )}}{{\left (a^{2} + b^{2}\right )} {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.08, size = 81, normalized size = 1.25 \[ -\frac {4 a b \arctanh \left (\frac {2 a \tan \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (2 a^{2}+2 b^{2}\right ) \sqrt {a^{2}+b^{2}}}-\frac {2 \left (-b \tan \left (\frac {x}{2}\right )+a \right )}{\left (a^{2}+b^{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.45, size = 105, normalized size = 1.62 \[ \frac {a b \log \left (\frac {b - \frac {a \sin \relax (x)}{\cos \relax (x) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \relax (x)}{\cos \relax (x) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (a - \frac {b \sin \relax (x)}{\cos \relax (x) + 1}\right )}}{a^{2} + b^{2} + \frac {{\left (a^{2} + b^{2}\right )} \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.38, size = 93, normalized size = 1.43 \[ \frac {2\,a\,b\,\mathrm {atanh}\left (\frac {2\,a^2\,b+2\,b^3-2\,a\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (a^2+b^2\right )}{2\,{\left (a^2+b^2\right )}^{3/2}}\right )}{{\left (a^2+b^2\right )}^{3/2}}-\frac {\frac {2\,a}{a^2+b^2}-\frac {2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )}{a^2+b^2}}{{\mathrm {tan}\left (\frac {x}{2}\right )}^2+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________